package com.aaa.controller;

import com.aaa.entity.ContractRent;
import com.aaa.entity.Result;
import com.aaa.query.ContractQuery;
import com.aaa.service.IContractRentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：李世磊
 * @date ：Created in 2021/1/29 20:36
 * @description：租入合同其他资产控制器
 * @modified By：
 * @version: 1.0
 */
@RestController
@RequestMapping("/rentElse")
public class ContractRentElseController {

    @Autowired
    IContractRentService service;

    /**
     *  租入合同  其他资产查询所有
     */

    @RequestMapping("/listAll")
    public Result listAllRentElse(){

        return service.listAllRentElse();
    }

    /**
     *  其他资产租入合同 添加合同
     * @param contract
     */

    @RequestMapping("/add")
    public Result addRentElse(@RequestBody ContractRent contract){

       return service.addRentElse(contract);
    }

    /**
     *  其他资产租入合同 删除合同
     * @param number
     */

    @RequestMapping("/del")
    public Result deleteRentElse(String number){

        return service.deleteRent(number);
    }


    /**
     *  其他资产租入合同 修改合同
     * @param contract
     */

    @RequestMapping("/update")
    public Result updateRent(@RequestBody ContractRent contract){

        return service.updateRentElse(contract);
    }

    /**
     *  分页 + 模糊查询
     * @param  query
     * @return
     */
    @RequestMapping("/query")
    public Result RentElseQuery(@RequestBody ContractQuery query){

        return service.rentElseQuery(query);
    }
}
